<!--
  智慧社区管理系统 - 应急预案
  @author Wu.Liang
  @date 2024-01-01
-->
<template>
  <div class="emergency-plan">
    <el-card>
      <template #header>
        <div class="card-header">
          <span>应急预案</span>
          <el-button type="primary" @click="handleAdd">新增预案</el-button>
        </div>
      </template>
      
      <el-table :data="planList" v-loading="loading" style="width: 100%">
        <el-table-column prop="name" label="预案名称" />
        <el-table-column prop="type" label="预案类型" />
        <el-table-column prop="level" label="紧急等级" />
        <el-table-column prop="description" label="预案描述" show-overflow-tooltip />
        <el-table-column prop="status" label="状态" />
        <el-table-column prop="updateTime" label="更新时间" />
        <el-table-column label="操作" width="200">
          <template #default="scope">
            <el-button size="small" @click="handleEdit(scope.row)">编辑</el-button>
            <el-button size="small" @click="handleDetail(scope.row)">详情</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'

const loading = ref(false)
const planList = ref([])

const handleAdd = () => {
  // 新增预案
}

const handleEdit = (row: any) => {
  // 编辑预案
}

const handleDetail = (row: any) => {
  // 查看预案详情
}

onMounted(() => {
  // 加载预案列表
})
</script>

<style scoped>
.emergency-plan {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
